BuffEffect100 = BaseBuffEffect:new();
BuffEffect100.__index = BuffEffect100;

function BuffEffect100:new()
    local object = {};
    setmetatable(object, BuffEffect100);
    return object;
end

function BuffEffect100:action(fight,buff,...)
    local result = select('3',...);
    local target = select('1',...);
    local skill = select('2',...);
    local skillBean = skill.skill.skillBean;
    local buffvalue = decodeJsonStrToTabel(buff.buffBean.f_Value);

    if skillBean.f_TriggerFigthHurt == EnumConst.SkillDamageTypeEnum.HEAL then
        return EnumConst.IBuffEffect.SUCCESS;
    end

    if buff.source.hp >= target.hp then
        fightLog("[EFFECT]Fighter "..buff.target.fighterId.." Buff"..buff.modelId.." 触发对生命值低于自身的目标可额外造成伤害效果");
        local damage = Mathf.Floor(result.damage * (EnumConst.TEN_THOUSANDTH + buffvalue[1])/EnumConst.TEN_THOUSANDTH);

        fightLog("[DAMAGE]"..buff.source.fighterId.."对"..buff.target.fighterId.."计算BUFF("..buff.modelId..")对生命值低于自身的目标可额外造成伤害[4]结果"..subDigitalNum(damage,4));
        result.damage = damage;
    end
    return EnumConst.IBuffEffect.REMOVE;
end
